package com.hongguan.oms.domain.sysmanager;

import java.io.Serializable;
import java.util.List;

/**
 * 
 * @author wangwei
 * @date 2010-3-10
 * @version
 */
public class TreeModel implements Serializable{
	protected String id;
	protected String text;
	protected String value;
	protected String parentId;
	protected String cls;
	protected String iconCls;
	protected Boolean checked;
	protected Boolean leaf;
	protected Boolean expandable;
	protected Boolean expanded;	
	protected List<TreeModel>children;	
	
	public Boolean getExpanded() {
		return expanded;
	}
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
	public String getParentId() {
		return parentId;
	}
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}
	public String getCls() {
		return cls;
	}
	public void setCls(String cls) {
		this.cls = cls;
	}
	public String getIconCls() {
		return iconCls;
	}
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	public Boolean getChecked() {
		return checked;
	}
	
	public Boolean getLeaf() {
		return leaf;
	}
	
	public Boolean getExpandable() {
		return expandable;
	}
	
	public List<TreeModel> getChildren() {
		return children;
	}
	public void setChildren(List<TreeModel> children) {
		this.children = children;
	}
	public void setLeaf(String leaf) {
		if(leaf!=null)
			this.leaf = Boolean.valueOf(leaf);
		if(this.leaf!=null&&this.leaf){
			this.iconCls = "icon-user";
			this.expandable=Boolean.FALSE;
		}else{
			this.iconCls = "icon-group";
			this.expandable=Boolean.TRUE;
		}
	}
	public void setExpanded(String expanded) {
		if(expanded!=null)
			this.expanded = Boolean.valueOf(expanded);
	}
	public void setChecked(String checked) {
		if(checked!=null)
			this.checked = Boolean.valueOf(checked);
	}
}
